<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>


<html:form action="/staticworksheet" >
   <script type="text/javascript" src="<%=request.getContextPath()%>/javascript/movetop.js"></script>
   <table border="0" align="center" width="75%" bordercolor="green">
       <tr>
           <td class="title">Worksheets</td>
       </tr> 
       <tr>
           <td>&nbsp;</td>
       </tr> 
       <tr>
           <td class="description-small">
           		<ul>
           			<li>Chosen Subject: <bean:write name="baseform" property="subject" /></li>
           		</ul>
           		<ul>
           			<li>Chosen Topic: <bean:write name="baseform" property="topic" /></li>
           		</ul>           		           
           </td>
       </tr>          
       <nested:notEmpty name="baseform" property="includeJsp">
       <tr>
       		<td>
       			<nested:define id="filepath" property='includeJsp'/>
       			<jsp:include page="<%=filepath%>" />
       		</td>
       </tr>
       </nested:notEmpty>

       <logic:notEmpty name="baseform" property="worksheets">
       <tr>
           <td class="description-small">
           		<ul>
           			<li>Displayed worksheets are in pdf &nbsp;<img align="top" src="<%=request.getContextPath()%>/image/acrobaticon.gif" border="0"/> format.</li>
           		</ul>
           </td>
       </tr>        
       <tr>
           <td><hr></td>
       </tr>        
       <tr>
           <td>
           		<table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#e7e7e7">
           			<tr>
           				<td colspan="2" class="tableheader">Worksheet</td>
           			</tr>
           			<nested:iterate property="worksheets">
           			<tr>
           				<td class="description-small">
           					<nested:write property="description"/>
           				</td>           			
           				<td>
   	   						<nested:define id="printkey" property="encryptedPrintKey"/>
   	   						<%
   	   							String printurl = request.getContextPath() + "/staticworksheet.do?action=swsdisplay&key=" + printkey;
   	   						%>
   							<a href="#" onclick="showPdf('<%=printurl%>'); return false;">
   								<img src="<%=request.getContextPath()%>/image/printer.jpg" border="0"/>
   							</a>           				
           				</td>
           			</tr>
           			<nested:notEmpty property="dynamicPdfLink">
           			<tr>
           				<td class="description-small">
           					<nested:write property="dynamicPdfLinkName"/>
           				</td>           			
           				<td>
	      					<nested:define id="pdfLink" property="dynamicPdfLink" />
							<%
							String pdfurl = request.getContextPath() + "/" + pdfLink;
							%>
							Click 
							<a href="<%=pdfurl%>" >
								<img src="<%=request.getContextPath()%>/image/printer.jpg" border="0"/>
							</a>           				
           				</td>           			
           			</tr>
           			</nested:notEmpty>
           			</nested:iterate>
           	   	</table> 
           </td>
       </tr> 
       </logic:notEmpty>
   </table>  
</html:form>
